<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="tfn" uri="http://www.totoro.com/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>购买过的店铺</title>
    <link rel="shortcut icon" type="image/x-icon" href="/static/img/index/favicon.png">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/public.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/iconFont/iconfont.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/user/bought_shop.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/nav.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/user/minirefresh.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/user/minirefresh.theme.taobao.min.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/user/common.css"/>

    <style>
        body, button, input, select, textarea {
            font: 12px/1.5 tahoma, arial, 'Hiragino Sans GB', '\5b8b\4f53', sans-serif;
        }
    </style>
</head>
<body class="mt-ml-1190">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/frame/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/frame/totoro-utils.js"></script>

<!-- nav start-->
<jsp:include page="${pageContext.request.contextPath}/public_page/nav.jsp"></jsp:include>
<div style="width: 100%; height: 6px; background-color: #F2F2F2"></div>
<!-- nav end-->

<!-- head start-->
<jsp:include page="${pageContext.request.contextPath}/public_page/ui_header.jsp"></jsp:include>
<!-- head end-->

<!-- main start-->
<div id="minirefresh" class="minirefresh-wrap">
<div id="page" class="page-shopbought">
    <div id="content">
        <div id="mercury">
            <div class="see-more">
                <div class="centertxt">
                    请到
                    <a href="/shop_collect_list_n.htm?tab=4" target="_blank" class="textlink">
                        <span class="iconfont icon-star"></span>
                        收藏夹
                    </a>
                    查看上新，我们将提供更丰富的内容
                    <a href="/shop_collect_list_n.htm?tab=4" target="_blank" class="boxlink">
                        去收藏夹看上新
                    </a>
                </div>
            </div>
            <div class="layout-center">
                <div class="grid-c2">
                    <div id="J_Col_Main" class="col-main">
                        <div class="main-wrap">
                            <div class="mercury-cont">

                                <!-- 店铺类别 start-->
                                <div class="fav-floatbar">
                                    <div class="fav-sel-list J_FavSelList fav-sel-list-show bought-sel-list" data-spm="">
                                        <div class="fav-sel-list-layout">
                                            <ul class="tag-box clearfix">
                                                <li class="${empty param.categoryId or param.categoryId==0?'tag-item-select':'tag-item'}">

                                                    <a tabindex="-1" class="tag-item-link" href="/user/boughtShop.htm?curr=${empty param.curr?'1':param.curr}">

                                                        <span>全部店铺</span>

                                                        <span></span>

                                                    </a>
                                                </li>
                                                <c:forEach items="${categoryMap}" var="category" varStatus="vs">
                                                    <li class="${param.categoryId == category.key.id?'tag-item-select':'tag-item'}">
                                                        <a title="${category.key.name}" tabindex="-1" class="tag-item-link" href="/user/boughtShop.htm?curr=${empty param.curr?'1':param.curr}&categoryId=${category.key.id}" data-spm="">
                                                            <span class="tagiconfont qt19"> </span>
                                                            <span>${category.key.name}</span>
                                                            <span>${category.value}</span>
                                                        </a>
                                                    </li>
                                                </c:forEach>
                                            </ul>
                                        </div>
                                        <div class="showmore J_ShowMore">
                                            <div class="open J_ShowMore_Open"><i class="open-icon"></i></div>
                                            <div class="close J_ShowMore_Close" style="display: none"><i class="close-icon"></i> </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- 店铺类别 end-->

                                <!-- 店铺搜索 start-->
                                <div class="mid-bar" data-spm="">
                                    <div class="floatleft">
                                        <div class="fav-search cleatfix">
                                            <form class="fav-search-panel-focused" id="J_FavSearchForm" name="favsearch" action="/user/boughtShop.htm" target="_top">
                                                <input name="_tb_token_" type="hidden" value="5abe67878e1e1">
                                                <input class="fav-search-panel-focused-timer" name="t" type="hidden" value="">
                                                <input id="" type="hidden" name="spm" value="a1z0k.7385961.1997985253.d4918985">
                                                <input type="hidden" name="type" value="10">
                                                <div class="fav-search-panel-fields">
                                                    <input id="fav-q" name="keyword" accesskey="s" autocomplete="off" x-webkit-speech="" x-webkit-grammar="builtin:translate" placeholder="搜索购买过的店铺" value="${param.keyword}" aria-haspopup="true" aria-combobox="list" role="combobox" class="search-combobox-input" aria-label="输入关键词搜索收藏夹内的店铺">
                                                </div>
                                                <div class="fav-search-button">
                                                    <button type="submit" class="fav-btn-search" data-spm-click="gostr=/tbscj;locaid=d1selbtn">搜索</button>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                                <!-- 店铺搜索 end-->

                                <!-- 店铺与商品信息 start-->
                                <div id="fav-list" class="minirefresh-scroll">
                                    <ul class="img-item-list J_FavList clearfix data-list" id="listdata">

                                    </ul>
                                </div>
                                <!-- 店铺与商品信息 end-->
                            </div>
                        </div>
                    </div>
                    <!-- left-->
                    <jsp:include page="${pageContext.request.contextPath}/public_page/ui-left.jsp"></jsp:include>
                    <style>
                        #boughtShop a{
                            color: #f40;
                        }
                    </style>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- main end-->

<!-- tail-->
<jsp:include page="${pageContext.request.contextPath}/public_page/last.html"></jsp:include>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/self/user/boughtShop.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/self/user/minirefresh.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/self/user/minirefresh.theme.taobao.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/self/user/common.js"></script>
<script>
    var curr = Totoro.getQueryVariable("curr")==false?'1':Totoro.getQueryVariable("curr");
    var categoryId = Totoro.getQueryVariable("categoryId")==false?'0':Totoro.getQueryVariable("categoryId");
    var keyword = Totoro.getQueryVariable("keyword")==false?'':Totoro.getQueryVariable("keyword");
    var buyShopData;
    // 初始化数据
    $.ajaxSettings.async = false;
    $.post("/user_logic/findBuyShopData.htm", {"curr": curr, "categoryId": categoryId, "keyword": keyword}, function (res) {
        buyShopData = eval("("+ res +")");
    });

        var appendTestData = Common.appendTestData,
            // 记录一个最新
            maxDataSize = buyShopData[1],
            nowSize = maxDataSize>10?10:maxDataSize,
            listDom = document.querySelector('#listdata'),
            requestDelayTime = 600;

        var miniRefresh = new MiniRefresh({
            container: '#minirefresh',
            down: {
                callback: function() {
                    setTimeout(function() {
                        // 每次下拉刷新后，上拉的状态会被自动重置
                        appendTestData(listDom, nowSize, true);
                        miniRefresh.endDownLoading(true);
                    }, requestDelayTime);
                },
                // 本主题独有的效果
                secretGarden: {
                    // 是否开启秘密花园（即类似淘宝二楼效果）
                    enable: true,
                    // 下拉超过200后可以出现秘密花园效果，注意，必须大于down的offset
                    offset: 200,
                    // 过度动画
                    duration: 1000,
                    // 提示文字
                    tips: '欢迎光临秘密花园',
                    inSecretGarden: function() {
                        // 可以像淘宝一样打开另一个页面，或者在本页面进行动画也行
                        console.log('进入秘密花园');
                        setTimeout(function() {
                            miniRefresh.resetSecretGarden();
                        }, 1000);
                    }
                }
            },
            up: {
                isAuto: true,
                callback: function() {
                    setTimeout(function() {
                        appendTestData(listDom, 10);
                        miniRefresh.endUpLoading(listDom.children.length >= maxDataSize ? true : false);
                    }, requestDelayTime);
                }
            }
        });

</script>
<jsp:include page="/public_page/open_chat.jsp"></jsp:include>
</body>
</html>
